package cemetery.bean;
import java.util.List;

public class Page {
	/**
	 * 当前页码 默认值为1 JSP获取
	 */
	private Integer pageIndex=1;
	/**
	 * 页面大小 默认值为2 JSP获取
	 */
	private Integer pageSize=2;
	/**
	 * 总条数 默认值没有数据 DB获取
	 */
	private Integer totalCount=0;
	/**
	 * 总页数 默认值没有数据 计算
	 */
	private Integer totalPage=0;
	/**
	 * 显示的页面数据 DB获取
	 */
	private List<materiel>list;
	
	
	
	public Integer getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}
	//设置获取总页数的算法
	public Integer getTotalPage() {
		if (this.totalCount%this.pageSize==0) {
			return this.totalCount/this.pageSize;
		}else {
			return (this.totalCount/this.pageSize)+1;
		}
	}
	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}
	public List<materiel> getList() {
		return list;
	}
	public void setList(List<materiel> list) {
		this.list = list;
	}
	

}
